<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

        <title>职位管理</title>

        <link href="../../css/mine.css" type="text/css" rel="stylesheet" />
        <script type="text/javascript">
            //执行批量删除，设置鉴别字段method为delete
            function deleteByRids() {
                document.getElementById("method").value="delete";
                document.getElementById("form").submit();
            }
            //执行数据导出,设置鉴别字段method为export
            function exportData() {
                document.getElementById("method").value="export";
                document.getElementById("form").submit();
            }

            //全选/反选
            function selectedAll() {
                var allsel = document.getElementsByName("rid");/* uid为复选框的name属性值 */
                for ( var i = 0; i < allsel.length; i++) {
                    allsel[i].checked = !allsel[i].checked;
                }
            }
        </script>
    </head>
    <body>
        <style>
            .tr_color{background-color: #9F88FF}
        </style>
        <div class="div_head">
            <span>
                <span style="float: left;">当前位置是：系统管理-》职位设置</span>
                <span style="float: right; margin-right: 8px; font-weight: bold;">
                    <a style="text-decoration: none;" href="/role/add-ui">【添加】</a>
                    <a href="javascript:void(0);" onclick="deleteByRids()">【删除】</a>

                </span>
            </span>
        </div>
        <div></div>
        <div class="div_search">
            <span>
                <form action="/role/list" method="post">
                    职位名称: 
					<input type="text"  name="roleName" value="${roleName}"/>
					 所属部门: 
					<input type="text" name="deptName"  value="${deptName}"/>
					是否启用: 
					<select name="used">
						<option value="1" ${used eq '1'?"selected":""}>是</option>
						<option value="0" ${used eq '0'?"selected":""}>否</option>
					</select>
                    <input value="查询" type="submit" />
					
                </form>
            </span>
        </div>
        <div style="font-size: 13px; margin: 10px 5px;">
            <form id="form" action="/role/delete-checked" method="post">
            <table class="table_a" border="1" width="100%">
                <input type="hidden" name="method" id="method">
                <tbody><tr style="font-weight: bold;">
                        <td width="40px;">序号</td>
                        <td width="30px;"><input type="checkbox" onchange="selectedAll()"/></td>
                        <td width="80px;"> 职位编码</td>
                        <td >职位名称</td>
						<td width="100px;">职位分类</td>
                        <td width="120px;">所属部门</td>                       
						<td width="120px;">状态</td>  
                        <td align="center" width="100px;">操作</td>
                    </tr>

                    <c:forEach items="${pageInfo.list}" var="role" varStatus="i">
                        <tr id="product1">
                            <td>${i.count}</td>
                            <td><input type="checkbox" name="rid" value="${role.id}"/></td>
                            <td>${role.permid}</td>
                            <td><a href="view.html">${role.permname}</a></td>
                            <td>${role.category}</td>
                            <td>${role.deptName}</td>
                            <td>${role.useState}</td>
                            <td>
                                <a href="/role/update-ui?rid=${role.id}">修改</a>
                                <c:if test="${role.permname != '系统管理员' and  role.permname != '公司领导'}">
                                    <a href="/role/delete-one?rid=${role.id}">删除</a>
                                </c:if>

                            </td>
                        </tr>
                    </c:forEach>



                <tr>
                    <td colspan="20" style="text-align: center;">
                        <a style="text-decoration: none;" href=
                                "/role/list?index=1
                                    &roleName=${roleName}&deptName=${deptName}&used=${used}">首页</a>
                        <a style="text-decoration: none;" href=
                                "/role/list?index=${pageInfo.prePage==0?1:pageInfo.prePage}
                                    &roleName=${roleName}&deptName=${deptName}&used=${used}">上一页</a>

                        <c:forEach var="i" begin="1" end="${pageInfo.pages}">
                            <a style="text-decoration: none;" href="/role/list?
                                index=${i}&roleName=${roleName}&deptName=${deptName}&used=${used}">${i}</a>
                        </c:forEach>

                        <a style="text-decoration: none;" href=
                                "/role/list?index=${pageInfo.nextPage==0?pageInfo.pages:pageInfo.nextPage}
                                    &roleName=${roleName}&deptName=${deptName}&used=${used}">下一页</a>

                        <a style="text-decoration: none;" href=
                                "/role/list?index=${pageInfo.pages}
                                    &roleName=${roleName}&deptName=${deptName}&used=${used}">尾页</a>

                        共${pageInfo.total}条 当前页 ${pageInfo.pageNum}/${pageInfo.pages} </a>
                    </td>
                </tr>
                </tbody>
            </table>
            </form>
        </div>
    </body>
</html>